package com.d3works.apps.base.service.tax;

import com.d3works.apps.account.db.AccountManagement;
import com.d3works.apps.account.db.FiscalPosition;
import com.d3works.apps.account.db.TaxEquiv;
import com.d3works.apps.account.db.TaxLine;
import com.d3works.apps.base.db.Company;
import com.d3works.apps.base.db.Product;
import com.d3works.exception.D3worksException;
import java.time.LocalDate;
import java.util.List;

public interface AccountManagementService {

  public AccountManagement getAccountManagement(
      List<AccountManagement> accountManagements, Company company);

  /**
   * Get product tax equiv from fiscal position.
   *
   * @param product
   * @param company
   * @param isPurchase specify if we want get the tax for purchase or sale
   * @return the tax equiv found for the product, null if nothing was found.
   * @throws D3worksException
   */
  TaxEquiv getProductTaxEquiv(
      Product product, Company company, FiscalPosition fiscalPosition, boolean isPurchase)
      throws D3worksException;

  /**
   * Obtenir la version de taxe d'un produit.
   *
   * @param product
   * @param amendment
   * @return
   * @throws D3worksException
   */
  public TaxLine getTaxLine(
      LocalDate date,
      Product product,
      Company company,
      FiscalPosition fiscalPosition,
      boolean isPurchase)
      throws D3worksException;
}
